package com.example.springbootlearn.testentity;

import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;

import java.util.Date;

/**
 * @author caiji Mr. Li
 * @date 2020/4/12 19:42
 */

@Slf4j
public class Dish {

    private String name;

    private boolean vegetarian;
    private int calories;
    private Type type;

    public Dish(String name, boolean vegetarian, int calories, Type type) {
        this.name = name;
        this.vegetarian = vegetarian;
        this.calories = calories;
        this.type = type;
    }

    public static void main(String[] args) {
        Date date = new Date();
//        String afei = StrUtil.format("用户【{}】,id【{}】同一天内只更新用户的一次记录时间，上一次主动报道时间为{}", "afei", 181L, date);
        log.info("用户【{}】,id【{}】同一天内只更新用户的一次记录时间，上一次主动报道时间为{}", "afei", 181L, DateUtil.formatDateTime(date));
    }

    @Override
    public String toString() {
        return "Dish{" +
                "name='" + name + '\'' +
                ", vegetarian=" + vegetarian +
                ", calories=" + calories +
                ", type=" + type +
                '}';
    }

    public String getName() {
        return name;
    }

    public boolean isVegetarian() {
        return vegetarian;
    }

    public int getCalories() {
        return calories;
    }

    public Type getType() {
        return type;
    }

    public enum Type {
        MEAT, FISH, OTHER
    }
}
